<?php
/**
 * @Author:      西北民大杨志宏
 * @DateTime:    2015-12-15 00:57:26
 * @Description: 复习知识点控制器
 */
defined('BASEPATH') OR exit('No direct script access allowed');

class Learn extends MY_Controller {

	// 定义了一个方法，方法的名称为index
	public function index()	{
        $data['content'] = $this->Kp->getLastCotent();
        // var_dump($data);
		$this->loadview('learn.html',$data);
	}

    public function updateDisplayTime()
    {
        $displayNumber = $this->input->post('displayNumber') + 1;
        $kid           = $this->input->post('kid');
        $this->Kp->updateDisplayTime($kid, $displayNumber);
    }

    public function getLastCotent()
    {
        $data = $this->Kp->getLastCotent();
        echo json_encode($data);
    }

}
